# -*- makefile -*-
# vim:se ft=make:

#OPT_SHARED_FLAGS	+= $(call CHECKCC,-finline-limit=10000,) 
#OPT_CXXFLAGS		+= $(call CHECKCXX,--param large-function-insns=10000)
#OPT_CFLAGS		+= $(call CHECKCC,--param large-function-insns=10000)

CROSS_COMPILE		?= x86_64-linux-gnu-

# The -Os option of gcc-4.0 sets max-inline-insns-single to 5 which prevents
# inlining of almost every function
NOOPT_SHARED_FLAGS-gcc  += $(call CHECKCC,--param max-inline-insns-single=50)
SHARED_FLAGS-gcc        += -mpreferred-stack-boundary=2
SHARED_FLAGS            += -m32

SHARED_FLAGS-$(CONFIG_REGPARM3)   += -mregparm=3
SHARED_FLAGS                      += $(call CHECKCC,-mno-mmx,)
SHARED_FLAGS                      += $(call CHECKCC,-mno-sse,)
SHARED_FLAGS                      += $(call CHECKCC,-mno-sse2,)
SHARED_FLAGS                      += $(call CHECKCC,-mno-sse3,)
SHARED_FLAGS                      += $(call CHECKCC,-mno-sse4,)
SHARED_FLAGS                      += $(call CHECKCC,-mno-sse4a,)
SHARED_FLAGS                      += $(call CHECKCC,-mno-3dnow,)
SHARED_FLAGS-clang                += $(call CHECKCC,-Wno-address-of-packed-member)

ASFLAGS				  += -m32
OBJCOPY_BFDNAME			  := elf32-i386
OBJCOPY_BFDARCH			  := i386
LD_EMULATION_CHOICE               := elf_i386 elf_i386_fbsd
